import http from "@/utils/request";

/***** 用户(User) 模块 *******/
export function isLogin() {
    return http.request({
        url: "/user/islogin",
        method: "get",
    });
}

export function logout() {
    return http.request({
        url: "/user/logout",
        method: "get",
    });
}

export function login(params) {
    return http.request({
        url: "/user/login",
        method: "post",
        data: params,
    });
}

export function register(params) {
    return http.request({
        url: "/user/register",
        method: "post",
        data: params,
    });
}

export function authorization() {
    return http.request({
        url: "/user/authorization",
        method: "get",
    });
}

export function getUserInfo() {
    return http.request({
        url: "/user/info",
        method: "get",
    });
}

export function saveUserInfo(body) {
    return http.request({
        url: "/user/info",
        method: "post",
        data: body
    });
}

export function getWallet() {
    return http.request({
        url: "/user/wallet",
        method: "get",
    });
}

export function onCashIn(body) {
    return http.request({
        url: "/user/onCashIn",
        method: "post",
        data: body
    });
}

export function onCashOut(body) {
    return http.request({
        url: "/user/onCashOut",
        method: "post",
        data: body
    });
}


